home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
mus
/
misc
/
NSM_iset.lha
/
iset
/
iset.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-02-26
|
2KB
|
72 lines
/*
Lets you specify the midichannel,
midipreset and volume on the current
instrument without using the mouse.
Made by Kjetil S. Matheussen 26.2.99.
e-mail: kjetilma@ifi.uio.no
Address:
Kjetil S. Matheussen
5423 Sogn Studentby
0858 Oslo
Norway
*/
#include <string.h>
#include "/nsm.h"
#include "/readstr.h"
void main(){
OCTABASE ob;
UWORD instrument;
int channel,preset,volume;
char *dosbase,*filehandle;
char string[80];
if((ob=getoctabase())==0) goto exit; /* Allways include this line first in
your plug-ins. */
dosbase=opendoslibrary();
filehandle=openoctacon(dosbase,450,70);
instrument=getcurrinstrument(ob);
sprintf(string,"Channel: %d - Preset: %d - Volume: $%x\n",getmidichannel(ob,instrument),getmidipreset(ob,instrument),getvolume(ob,instrument));
writestring(dosbase,filehandle,string,strlen(string));
writestring(dosbase,filehandle,"New Channel: ",14);
readstring(dosbase,filehandle,string,70);
if(*string!=0){
sscanf(string,"%d",&channel);
if(channel>=0 && channel<17)
sendrexxword("IN_SETMIDICHANNEL ",channel,"");
}
writestring(dosbase,filehandle,"New Preset: ",12);
readstring(dosbase,filehandle,string,70);
if(*string!=0){
sscanf(string,"%d",&preset);
if(preset>=0 && preset<=2800)
sendrexxword("IN_SETMIDIPRESET ",preset,"");
}
writestring(dosbase,filehandle,"New Volume: $",14);
readstring(dosbase,filehandle,string,70);
if(*string!=0){
sscanf(string,"%x",&volume);
if(volume>=0 && volume<=0x40)
sendrexxword("IN_SETVOLUME ",volume,"");
}
close:
closefile(dosbase,filehandle);
closedoslibrary(dosbase);
exit:
}